import router from "./router";

const witeList = [
    "/login"
];

router.beforeEach((to, form, next) => {
    if (witeList.indexOf(to.path) > -1) {
        next();
    }
    else {
        let token = localStorage.getItem("token");
        if (token == undefined || token == null || token == "") {
            next('/login');
            
        }
        else {
            //查询是否过期 不检查 直接跳过 当他请求接口的时候再去判断
            next();
        }
    }

})